home *** CD-ROM | disk | FTP | other *** search
/ Champak 130 / Vol 130.iso / games / atlantis.swf / scripts / DefineSprite_835_endscreen / frame_1 / DoAction.as
Encoding:
Text File  |  2008-11-13  |  2.6 KB  |  123 lines

  1. function ConvertText(hint)
  2. {
  3.    var _loc3_ = "";
  4.    var _loc1_ = 0;
  5.    while(_loc1_ < hint.length)
  6.    {
  7.       var _loc2_ = hint.substr(_loc1_,1);
  8.       if(_loc2_ == "|")
  9.       {
  10.          _loc3_ += "\n";
  11.       }
  12.       else
  13.       {
  14.          _loc3_ += _loc2_;
  15.       }
  16.       _loc1_ = _loc1_ + 1;
  17.    }
  18.    return _loc3_;
  19. }
  20. function DrawArt()
  21. {
  22.    var i = 1;
  23.    while(i <= ArtPos.length)
  24.    {
  25.       var Name = letter + "slice" + i;
  26.       var X = ArtPos[Number(Name.substr(6,2))].x;
  27.       var Y = ArtPos[Number(Name.substr(6,2))].y;
  28.       this.attachMovie(Name,Name,this.getNextHighestDepth());
  29.       eval(Name)._x = X + 30;
  30.       eval(Name)._y = Y + 80;
  31.       i++;
  32.    }
  33.    this.attachMovie(letter + "normal","normal",this.getNextHighestDepth(),{_x:45,_y:110,_alpha:0});
  34. }
  35. function movestars()
  36. {
  37.    i = 0;
  38.    while(i < N)
  39.    {
  40.       eval("b" + i)._x += Math.random() * 1 - 0.5;
  41.       eval("b" + i)._y += Math.random() * 1 - 0.5;
  42.       i++;
  43.    }
  44.    updateAfterEvent();
  45. }
  46. stop();
  47. if(_root.SoundOn)
  48. {
  49.    _root.Art_s.start();
  50. }
  51. letter = "g";
  52. if(_root.RoundCountry == 1)
  53. {
  54.    letter = "b";
  55. }
  56. else if(_root.RoundCountry == 2)
  57. {
  58.    letter = "e";
  59. }
  60. N = 50;
  61. ArtPos = _root.ArtPos;
  62. DrawArt();
  63. i = 0;
  64. while(i < N)
  65. {
  66.    r = Math.random() * 30 + normal._height / 2 - 20;
  67.    w = Math.random() * 3.141592653589793 * 2;
  68.    x = r * Math.cos(w) + 45 + normal._width / 2;
  69.    y = r * Math.sin(w) + 110 + normal._height / 2;
  70.    this.attachMovie("movingstar","b" + i,this.getNextHighestDepth(),{_x:x,_y:y,_alpha:100});
  71.    eval("b" + i).gotoAndPlay(Math.round(Math.random() * 40 + 1));
  72.    i++;
  73. }
  74. _root.TextShow(txtt,_root.countries[_root.RoundCountry],"t",0,0,0);
  75. _root.TextShow(txt,_root.textcontinue,"b",0,0,1);
  76. format = new TextFormat();
  77. format.font = "Arial";
  78. format.size = "16";
  79. format.bold = true;
  80. format.color = 12303155;
  81. this.createEmptyMovieClip("H1",this.getNextHighestDepth());
  82. H1._x = 200;
  83. H1._y = 150;
  84. _root.TextShow(H1,_root.artdescription[_root.RoundCountry],"b",-2,20,0);
  85. clearInterval(ms);
  86. clearInterval(ap);
  87. clearInterval(dp);
  88. clearInterval(aap);
  89. clearInterval(aaap);
  90. ap = setInterval(function()
  91. {
  92.    normal._alpha = 100;
  93.    dp = setInterval(function()
  94.    {
  95.       clearInterval(dp);
  96.       normal._alpha = 0;
  97.    }
  98.    ,500);
  99. }
  100. ,1000);
  101. aap = setInterval(function()
  102. {
  103.    clearInterval(ap);
  104.    clearInterval(aap);
  105.    normal._alpha = 0;
  106.    aaap = setInterval(function()
  107.    {
  108.       normal._alpha += 1;
  109.       i = 0;
  110.       while(i < N)
  111.       {
  112.          eval("b" + i)._alpha -= 1;
  113.          i++;
  114.       }
  115.       if(normal._alpha >= 100)
  116.       {
  117.          clearInterval(aaap);
  118.       }
  119.    }
  120.    ,0);
  121. }
  122. ,5000);
  123.